package org.example.mapper;

import org.example.pojo.*;

import java.util.List;
import java.util.Map;

public interface DepartmentMapper {
    /**
     * 查询所有部门
     * @return
     */
//    @Select("select * from department")
    List<Department> selectDepartmentAllByPage();

    /**
     * 关键字搜索
     * @param message
     * @return
     */
    List<Department> selectDepartmentByNameAndPage(String message);

    /**
     * 通过id查询部门
     * @param dId
     * @return
     */
    List<Department> selectDepartmentById(Integer dId);

    /**
     * 修改部门信息
     * @param departmentRegister
     * @return受影响的行数
     */
//    @Update("")
    int updateDepartment(DepartmentRegister departmentRegister);

    /**
     * 通过id删除部门
     * @param dId
     * @return受影响的行数
     */
//    @Delete("")
    int deletDepartment(int dId);
    /**
     * 添加部门
     * @param dpartmentAdd
     * @return 受影响的行数
     */
//    @Insert("insert into department values(#{}) ")
    int insertDepartment(DpartmentAdd dpartmentAdd);

    /**
     * 查询部门架构
     * @return
     */
    List<Map<String,Object>> selectDepartmentArch();
//    @Select("select from depa")

    /**
     * 通过部门查询员工姓名
     * @return
     */
    List<DepartmentEmployee> selectEmployeeNameByDepartment(String dName);

    /**
     * 通过Id查询员工信息
     * @param eId
     * @return
     */
    DepartmentEmployee selectEmployeeById(int  eId);

    /**
     * 查询部门id和name
     * @return
     */
    List<DepartmentIdAndName> selectDepartmentIdAndName();

    /**
     * 查询部门等级
     * @return
     */
    List<String> selectDepartmentFirst(int dParentId);
}
